import React, { Component } from 'react'
import PropTypes from 'prop-types'
class Liitem extends Component {
    constructor(props) {
        super(props);
        this.state = {  };
    }
    handleClick(){
        console.log(this.props.index)
        this.props.deleteItem(this.props.index)
    }
    render() {
        return (
            <div>
                <div onClick={this.handleClick.bind(this)}>
                 {this.props.avname}:{this.props.content}</div>
            </div>
           
        );
    }
}
Liitem.propTypes={
    content:PropTypes.string,
    deleteItem:PropTypes.func,
    index:PropTypes.number,
    avname: PropTypes.string.isRequired
}
Liitem.defaultProps = {
    avname:'evan'
}
export default Liitem;